package org.winFame;

import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.geometry.Pos;
import javafx.scene.layout.FlowPane;

public class FlowPaneFrameWork {
    public static FlowPane flowPane = new FlowPane ();
    static {
        init();
    }
    public static void init() {
        flowPane.setStyle("-fx-background-color: #fafafa;");
        flowPane.setVgap(20);
        flowPane.setHgap(20);
        flowPane.setAlignment(Pos.CENTER_LEFT);
        WinShow.scrollPane.widthProperty().addListener(new ChangeListener<Number>() {
            @Override
            public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {
                flowPane.setPrefWidth((Double) newValue);
            }
        });

        WinShow.scrollPane.heightProperty().addListener(new ChangeListener<Number>() {
            @Override
            public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {
                flowPane.setPrefHeight((Double) newValue);
            }
        });
    }
}
